package com.handu.luna.core.domain.promotion;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/*import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.NoRepositoryBean;*/



import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.handu.luna.core.domain.BaseRepository;
import com.handu.luna.core.domain.promotion.PostForFreeActivity.PostForFreeType;


/**
 * Created by  liuxx on 2014/7/22.
 */
//public interface PostForFreeActivityRepository<T extends BonusPromotion> extends PromotionRepository<T>{
public interface PostForFreeActivityRepository extends JpaRepository<PostForFreeActivity,Long>,BaseRepository<PostForFreeActivity>,JpaSpecificationExecutor<PostForFreeActivity> {
  
	
	@Query("select goodsIdArr from PostForFreeActivity where startDate <= CURRENT_TIMESTAMP and endDate >= CURRENT_TIMESTAMP and postForFreeType = :type ")
	List<String> findCurrentPost4FreeGoodsId(@Param("type")PostForFreeType type);
}
